package com.up.interview.redis.redisson;

import lombok.Getter;

/**
 * @author: liuchengjun
 * @title: LockRequest
 * @projectName: 海联技术中台V2.0
 * @depart 软件事业部
 * @description:
 * @date: 2025/10/20/周一 16:21 (星期一)
 * @since V2.0
 */
public class LockRequest {
    @Getter
    private final String lockPath;
    private final ReturnCallBack<?> call;

    public LockRequest(String lockPath, ReturnCallBack<?> call) {
        this(lockPath,call,false);
    }
    public LockRequest(String lockPath, ReturnCallBack<?> call,boolean forceUseProcessLock) {
        this.lockPath = lockPath;
        this.call = call;
    }
    public LockRequest(String lockPath, boolean forceJvmLock) {
        this(lockPath, null,forceJvmLock);
    }

    public LockRequest(String lockPath) {
        this(lockPath, null,false);
    }

    public Object call() throws Exception {
        return this.call.call();
    }
}
